<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Add Debt</title>
    <link rel="icon" type="image/png" href="{{ url_for('static', filename='phillfinance.png') }}">
    <link rel="stylesheet" href="{{ url_for('static', filename='styles.css') }}">
</head>
<body>
    <nav>
        <ul>
            <li><a href="{{ url_for('home') }}">Home</a></li>
            {% if current_user.is_authenticated %}
                <li><a href="{{ url_for('dashboard') }}">Dashboard</a></li>
                <li><a href="{{ url_for('logout') }}">Logout</a></li>
            {% else %}
                <li><a href="{{ url_for('login') }}">Login</a></li>
                <li><a href="{{ url_for('register') }}">Register</a></li>
            {% endif %}
        </ul>
    </nav>

    <div class="container">
        <h1>Add Debt</h1>

        {% with messages = get_flashed_messages() %}
            {% if messages %}
                <ul>
                    {% for message in messages %}
                        <li>{{ message }}</li>
                    {% endfor %}
                </ul>
            {% endif %}
        {% endwith %}

        <!-- Debt form -->
        <form method="POST" action="{{ url_for('add_debt') }}">
            {{ form.hidden_tag() }}

            <div class="form-group cool-date-field">
                <label for="amount">Debt Amount:</label>
                {{ form.amount(class="form-control", placeholder="Enter debt amount") }}
            </div>

            <div class="form-group cool-date-field">
                <label for="description">Debt Description:</label>
                {{ form.description(class="form-control", placeholder="Enter a description of the debt") }}
            </div>

            <div class="form-group cool-date-field">
                <label for="date_added" class="form-label">Date Added:</label>
                {{ form.date_added(class="form-control stylish-input", placeholder="Select a date") }}
            </div> <br>
            

            <div class="form-group">
                <button type="submit" class="btn btn-primary">Add Debt</button>
                <a class="button" href="{{ url_for('dashboard') }}">Back to Dashboard</a>
            </div>
            
        </form>

       
    </div>
</body>
</html>
